home *** CD-ROM | disk | FTP | other *** search
Wrap
<%@ Language=VBScript CODEPAGE=65001 %> <!--#include file="include/wmsLocStrings.inc"--> <!--#include file="include/wmsHeader.inc"--> <!--#include file="include/wmsServerHash.inc"--> <!--#include file="include/wmsPlugins.inc"--> <!--#include file="include/wmsError.inc"--> <% '+------------------------------------------------------------------------- ' ' Microsoft Windows Media ' Copyright (C) Microsoft Corporation. All rights reserved. ' ' File: Plugin_Dialog.asp ' ' Contents: ' '-------------------------------------------------------------------------- BeginErrorHandling ConnectToPlugin on error resume next Dim strErrorDescription Dim bOpIsRename Dim bError Dim strNewName Dim strHelpTopic Dim strPageTitle Dim strOp Dim strPluginIndex strOp = GetPostOrQsVal( "op" ) strPluginIndex = trim( GetPostOrQsVal( "pluginIndex" ) ) bOpIsRename = FALSE if( 0 = StrComp( "rename", strOp, vbTextCompare ) ) then strPageTitle = L_RENAMEPL_TEXT bOpIsRename = TRUE strHelpTopic = H_PLRENAMETOPIC elseif( 0 = StrComp( "duplicate", strOp, vbTextCompare ) ) then strPageTitle = L_DUPLICATEPL_TEXT bOpIsRename = FALSE strHelpTopic = H_PLDUPLICATETOPIC end if bError = FALSE strNewName = Left( SafeUnescape( GetFormStr( "newPluginName" ) ), MAX_LEN_PLUGINNAME ) if( 0 < Len( strNewName ) ) then if bOpIsRename then if PluginNameIsLegal( strNewName ) then g_objPlugin.Name = strNewName end if else ClearError g_objPluginCollection.Clone CStr( strNewName ), g_objPlugin end if if( ErrorDetected( "name" ) ) then bError = TRUE Session( "PageReloadedToDisplayError" ) = 1 else Response.Clear if ( FALSE = IsEmpty( g_objPubPoint ) ) then Response.Redirect( "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&pluginIndex=" & strPluginIndex ) else Response.Redirect( "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & g_strCategory & "&pluginIndex=" & strPluginIndex ) end if end if end if strErrorDescription = Left( CStr( GetPostOrQsVal( "error" ) ), MAX_PATH ) '//////////////////////////////////////////////////////////////// Function CreateNewPluginName( strPPName ) Dim strTemplate strTemplate = L_COPYOFPLUGTEMPL_TEXT CreateNewPluginName = Replace( strTemplate, "___", strPPName, 1 ) End Function '///////////////////////////////////////////////////////////////////// Function PluginNameIsLegal( strPluginName ) PluginNameIsLegal = TRUE Dim regEx Set regEx = New RegExp regEx.Pattern = "/%|\\|\&|\<|\>|\f|\n|\r|\x22|\x201C|\x201D|\x201E/gi" regEx.IgnoreCase = TRUE regEx.Global = TRUE regEx.Multiline = TRUE if( TRUE = regEx.Test( strPluginName ) ) then PluginNameIsLegal = FALSE Exit Function end if End Function WriteHTMLHeader( strPageTitle ) %> <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>"> <% WritePluginJSUtils %> <script language="JavaScript"> <!-- /*@cc_on @*/ var g_bNameAlerted = false; <% WriteCommonJSUtils %> var dbgNumFilterWarnings = 0; ////////////////////////////////////////////////////////////////////////// function InitFilters() { <% jsTRY %> var szNewPluginName = new String( document.pluginForm.newPluginName.value ); document.pluginForm.newPluginName.focus(); if( 0 >= szNewPluginName.length ) { return; } else { document.pluginForm.newPluginName.disabled = false; document.pluginForm.newPluginName.focus(); } var szOriginalPluginName; szOriginalPluginName = new String( "<%= g_strPluginName %>" ); if( szNewPluginName.toUpperCase() == szOriginalPluginName.toUpperCase() ) { document.pluginForm.ok.disabled = true; } <% if "" <> GetPostOrQsVal( "error" ) then %> HandleError(); <% end if %> <% jsCATCH %> } ////////////////////////////////////////////////////////////////////////// function CheckPluginName() { <% jsTRY %> var szName; var bCanBeEnabled; var bValidName = false; var szIllegalPluginNameChars; var i; bCanBeEnabled = true; szName = new String( document.pluginForm.newPluginName.value ); // perform left trim szName = szName.replace( /^\s+/, "" ); // perform right trim szName = szName.replace( /\s+$/, "" ); if( ( 0 == szName.length ) || ( "<%= EscBackslashChar( ucase( g_strPluginName ) ) %>" == szName.toUpperCase() ) ) { bCanBeEnabled = false; } bValidName = false; var szIllegalChars = /\\|\%|\&|\<|\>|\"|\f|\n|\r|\x22|\x201C|\x201D|\x201E/gi; if( -1 == szName.search( szIllegalChars ) ) { bValidName = true; } if( false == bValidName ) { document.pluginForm.newPluginName.style.color = "#ff0000"; document.pluginForm.ok.disabled = true; window.status = "<%= L_INVALIDCHARSINPLNAME_TEXT & "\\ % & < > \" & chr(34) %>"; if( false == g_bNameAlerted ) { g_bNameAlerted = true; window.alert( "<%= L_INVALIDCHARSINPLNAME_TEXT & "\n\\ % & < > \" & chr(34) %>" ); document.pluginForm.newPluginName.focus(); } } else { document.pluginForm.newPluginName.style.color = "#000000"; document.pluginForm.ok.disabled = ! bCanBeEnabled; window.status = ""; } <% jsCATCH %> } /////////////////////////////////////////////////////////////////////// function HandleError() { <% jsTRY %> <% if( "duplicate" = strErrorDescription ) then %> window.alert("<%= RemoveDangerousCharacters( CStr( g_strDecodedServerName ) & L_DUPLICATENAME_TEXT ) %>"); <% elseif( "hostnotavailable" = strErrorDescription ) then %> window.alert("<%= RemoveDangerousCharacters( CStr( g_strDecodedServerName ) & L_BADHOSTNAME_TEXT ) %>"); <% elseif( "nowms" = strErrorDescription ) then %> window.alert("<%= RemoveDangerousCharacters( CStr( g_strDecodedServerName ) & L_NOWMS_TEXT ) %>"); <% elseif( "serviceerror" = strErrorDescription ) then %> window.alert("<%= RemoveDangerousCharacters( CStr( g_strDecodedServerName ) & L_SERVICEINERROR_TEXT ) %>"); <% else %> // document.location.replace( "pubpoint_collection.asp" ); <% end if %> <% jsCATCH %> } /////////////////////////////////////////////////////////////////////// function ValidateInput() { <% jsTRY %> var szOriginalName; var newPluginName; if( document.pluginForm.ok.disabled ) { event.cancelBubble=1; return false; } <% jsCATCH %> } --> </script> </head> <body bgcolor="<%= colorTabLight %>" topmargin="10" leftmargin="10" rightmargin="10" marginwidth="10" marginheight="10" onload="JavaScript:InitFilters();" oncontextmenu="JavaScript:event.cancelBubble=true;return false;"> <% BeginErrorHandling %> </body> <% WriteStdPluginForm %> <input type="hidden" name="op" value="<%= GetPostOrQsVal( "op" ) %>"> <input type="hidden" name="pluginIndex" value="<%= GetPostOrQsVal( "pluginIndex" ) %>"> <table cellspacing=0 cellpadding=4 <% if brMSIE = g_dwBrowserType then %>class="dialogframe" <% else %> bgcolor="lightgrey" <% end if %> border=3><tr><td> <table width="100%" cellspacing="5" cellpadding=0 cols="3" border="0"> <tr> <td width=40 valign="middle" align="left"> <% if bOpIsRename then %> <img src="img/rename_icon32.gif" valign="middle" width=32 height=32> <% else %> <img src="img/dupplugin_icon32.gif" valign="middle" width=32 height=32> <% end if %> </td> <td valign="bottom" align="left" class="header"> <% if bOpIsRename then %> <%= Server.HTMLEncode( L_RENAMEPL_TEXT ) %> <% else %> <%= Server.HTMLEncode( L_DUPLICATEPL_TEXT ) %> <% end if %> </td> </tr> </table> <table width="100%" cellspacing="1" cellpadding="1" border="0"> <tr> <td width="32"> </td> <td align="left" valign="middle"> </td> </tr> <tr> <td class="defaultcursor" colspan="2"> <% RenderWithErrorCheck Server.HTMLEncode( L_PLUGINNAMECOLON_TEXT ), "name" %> </td> </tr> <tr> <td align=left colspan="2"> <input type="text" maxlength="<%= Server.HTMLEncode( MAX_LEN_PLUGINNAME ) %>" name="newPluginName" tabindex=1 size="<% if brMSIE = g_dwBrowserType then %>60<% else %>80<% end if %>" <% if bOpIsRename then %> value="<% if( "" = qs("newPluginName") ) then Response.Write( RemoveSpecifiedChars( g_strPluginName, REGEXP_DANGEROUS_CHARS ) ) else Response.Write( RemoveSpecifiedChars( SafeUnescape( qs("newPluginName") ), REGEXP_DANGEROUS_CHARS ) ) end if %>" <% else %> value="<% if( 0 = Len( qs("newPluginName") ) ) then strCopyName = CreateNewPluginName( g_strPluginName ) else strCopyName = CreateNewPluginName( qs("newPluginName") ) end if Response.Write( RemoveDangerousCharacters( strCopyName ) ) %>"<% end if %> onKeyUp="JavaScript:CheckPluginName();" onKeyDown="JavaScript:CheckPluginName();" onChange="JavaScript:CheckPluginName();" onPaste="JavaScript:CheckPluginName();" AUTOCOMPLETE="OFF" > </td> <td width=32> </td> </tr> </table> <p> <table cellspacing=4 cellpadding=0 border="0"> <tr> <td align=left> <INPUT type="submit" name="ok" onclick="JavaScript:ValidateInput();" tabIndex=2 value="<%= Server.HTMLEncode( L_OKAYBUTTON_TEXT ) %>"> </td> <td align=left> <INPUT name="cancel" onclick="JavaScript:Cancel();" tabIndex="3" type=button value="<%= Server.HTMLEncode( L_CANCELBUTTONSPACED_TEXT ) %>"> </td> <td align=left> <INPUT name="help" onclick="JavaScript:DoHelp( '<%= H_PPLEVEL %>','<%= strHelpTopic %>' );" tabIndex=4 type=button value="<%= Server.HTMLEncode( L_HELPBUTTONSPACED_TEXT ) %>"> </td> <td align=left> </td> </tr> </table> </td></tr></table> </form> <% AlertUserWithPopupErrorDialog %> <% OnErrorGoBack %> </body> </html> <% EndErrorHandling "plugin_dialog.asp" on error resume next PluginsASPCleanup %>